package com.xugongwei.blog.controller;

import com.xugongwei.blog.business.service.BizStatisticsService;
import com.xugongwei.blog.business.service.SysConfigService;
import com.xugongwei.blog.framework.object.ResponseVO;
import com.xugongwei.blog.util.ResultUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 统计数据
 *
 * @author xugongwei (isxugongwei(a)gmail.com)
 * @version 1.0
 * @date 2019/4/6 21:05
 */
@Slf4j
@RestController
@RequestMapping("/statistics")
public class RestStatisticsController {

    @Autowired
    private SysConfigService configService;
    @Autowired
    private BizStatisticsService statisticsService;

    /**
     * 获取网站详情
     *
     * @return 网站详情
     */
    @RequestMapping("/siteInfo")
    public ResponseVO getSiteInfo() {
        return ResultUtil.success("", configService.getSiteInfo());
    }

    /**
     * 获取文章分类统计
     *
     * @return 文章分类统计
     */
    @RequestMapping("/listType")
    public ResponseVO listType() {
        return ResultUtil.success("", statisticsService.listType(10));
    }

}
